package com.shxt.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.shxt.model.J_position_city;
import com.shxt.model.J_position_county;
import com.shxt.model.J_position_provice;
import com.shxt.model.J_position_town;
import com.shxt.service.J_position_cityService;
import com.shxt.service.J_position_countyService;
import com.shxt.service.J_position_proviceService;
import com.shxt.service.impl.J_position_townService;

@Controller
public class cityContriller {
    
    @Autowired
    private J_position_proviceService j_position_proviceService;
    @Autowired
    private J_position_cityService j_position_cityService;
    @Autowired
    private J_position_countyService j_position_countyService;
    @Autowired
    private J_position_townService j_position_townService;
    

    @RequestMapping("city/province")
    @ResponseBody
    public List<J_position_provice>  provinceList(){

        return j_position_proviceService.provList();
    }
    



    @RequestMapping("city/city")
    @ResponseBody
    public List<J_position_city> cityList(Integer province_id){

        return j_position_cityService.listByProv(province_id);
    }
    



    @RequestMapping("city/county")
    @ResponseBody
    public List<J_position_county> countyList(Long city_id){



        return j_position_countyService.listByCity(city_id);
    }
    



    @RequestMapping("city/town")
    @ResponseBody
    public List<J_position_town> townList(Long county_id){

        return j_position_townService.listByCounty(county_id);
    }
    
}
